package com.daxt.controller.system;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daxt.common.result.Result;
import com.daxt.common.result.ResultCode;
import com.daxt.common.result.ResultUtil;
import com.daxt.mapper.sys.SystemConfigMapper;
import com.daxt.model.dic.SystemConfigType;
import com.daxt.model.service.base.vo.SystemConfig;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


@Api(tags = "文档")
@RestController
public class SwaggerController {


	
	@Autowired
	private SystemConfigMapper systemConfigMapper;
	@ApiOperation(value = "获取DOCURL", notes = "") 
	@GetMapping("/swagger/url") 
	public Result<SystemConfig> url(){
		
		QueryWrapper<SystemConfig> queryWrapper=new QueryWrapper<SystemConfig>();
		queryWrapper.eq("sysKey", SystemConfigType.DOC_RUL.getKey());
		List<SystemConfig> list = systemConfigMapper.selectList(queryWrapper);
		SystemConfig systemConfig=new SystemConfig();
		if(list!=null&&list.size()>0) {
			systemConfig = list.get(0);
		}
		return ResultUtil.data(ResultCode.RESULT_SUCCESS.getCode(), null, systemConfig);
	}

}
